class chongwu:

    def __init__(self,name,age):
        self.name = name
        self.age = age
        self.__serect = '秘密'

    def eat(self,food):
        print('{}吃{}'.format(self.name,food))

    def __fun1(self):
        print(self.__serect)

cat = chongwu('猫',6)
cat.eat('饼干')

# 子类是特殊的父类
class Student(chongwu):
# class  子类(父类)
    def __init__(self, name, age,banji):
        self.name = name
        self.age = age
        self.banji = banji
        self.__serect = '秘密'
    def study(self,place):
        print('在{}学习'.format(place))
    def eat(self,food):
        print('我是凶狠的花猫')
        print('喵喵是{}要吃{}'.format(self.name,food))

s1 = Student('你的小可爱',6,'花猫班')
#  if子类对于父类中属性或方法不满
#     属性的覆盖或者重写  overwrite
print(s1)

print(s1.name)
print(s1.age)
print(s1.banji)
s1.eat('鱼')
# s1.study('教室')
# 方法的调用
#   子类有用子类
#   无则用父类





















